<template>
    <div>
        <p>商品名称：<input type="text" v-model="name"></p>
        <p>商品价格：<input type="text" v-model="price"></p>
        <p>商品照片：<input type="text" v-model="img"></p>
        <p>商品简介：<input type="text" v-model="status"></p>
        <p>商品类型：<input type="text" v-model="addtime"></p>
        <p><input type="button" value="添加" @click="tianj()"></p>
    </div>
</template>
<script>
import axios from 'axios'
export default {
    name:"tianjia",
    data(){
        return{
            name:"",
            price:"",
            img:"",
            status:"",
            addtime:""
        }
    },
    methods:{
        tianj(){
            var form_data = new FormData()
            form_data.append=this.name
            form_data.append=this.price
            form_data.append=this.img
            form_data.append=this.status
            form_data.append=this.addtime
            axios({
                url:"http://127.0.0.1:8000/zks/",
                params:"post",
                data:form_data
            }).then(res=>{
                console.log(res.data);
            })
        }
    }
}
</script>

<style>

</style>
